/*
 * Bbs.java
 *
 * Created on 2007/10/14 +0900
 *
 * $Revision: 38 $
 * $Date: 2008-10-11 08:48:45 +0000 (Sat, 11 Oct 2008) $
 */

package org.gikolet.bbs.data;

import org.gikolet.framework.util.Assert;

/**
 * @author Tetsutaro (latest modification by $Author: tetsutaro.ss $)
 * @version $Revision: 38 $ $Date: 2008-10-11 08:48:45 +0000 (Sat, 11 Oct 2008) $
 */
public class Bbs {
    private String type;

    private String name;

    public Bbs(String type, String name) {
	Assert.isNotNullAndEmpty(type);
	Assert.isNotNullAndEmpty(name);

	this.type = type;
	this.name = name;
    }

    public void setType(String type) {
	Assert.isNotNullAndEmpty(type);

	this.type = type;
    }

    public String getType() {
	return this.type;
    }

    public void setName(String name) {
	Assert.isNotNullAndEmpty(name);

	this.name = name;
    }

    public String getName() {
	return this.name;
    }

    public int hashCode() {
	return this.type.hashCode();
    }

    public boolean equals(Object obj) {
	if (obj instanceof Bbs) {
	    return equals((Bbs) obj);
	}
	return false;
    }

    public boolean equals(Bbs bbs) {
	if (bbs == null) {
	    return false;
	}
	return this.type.equals(bbs.type);
    }
}
